package sensors.virtualSensors;

import maze.Location;
import robots.OwnGhost;
import robots.VirtualGhost;
import sensors.LightSensor;
import simulation.Simulator;

public class VirtualLightSensor  extends VirtualSensor implements LightSensor{

	public VirtualLightSensor(VirtualGhost ghost, Simulator sim, boolean randomValues){
		super(ghost, sim,randomValues);
	}

	@Override
	public int readValue() {
		return simulateLightSensor();
	}
	private int simulateLightSensor() {
		Location loc = getSimulator().getGhostLocations().get(getGhost());
		return  getSimulator().getColorMap().GetSensorReading((int) (loc.x + 0.5f), (int) (loc.y + 0.5f));
	}
}
